//
//  BMSAuthSDK.h
//  WDBMS
//
//  Created by YeJary on 2025/5/12.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^BMSInitCompletion)(BOOL success,
                                 BOOL privacyAgreed,
                                 BOOL trackingAuthorized,
                                 BOOL didRealname,
                                 NSString *uuid);

@interface BMSAuthSDK : NSObject

+ (BMSAuthSDK *)shareInstance;

/// IP 屏蔽接口
/// - Parameters:
///   - appName: BMS 唯一标识符
///   - channel: 游戏渠道
///   - version: 游戏版本
///   - ip: IP 地址（可不传）
///   - success: 成功回调
///   - failure: 失败回调
- (void)checkIPBlockStatusWithAppName:(NSString *)appName
                              channel:(NSString *)channel
                              version:(NSString *)version
                                   ip:(nullable NSString *)ip
                              success:(void(^)(NSDictionary *response))success
                              failure:(void(^)(NSError *error))failure;

/// 获取官方节假日列表
/// - Parameters:
///   - success: 成功回调
///   - failure: 失败回调
- (void)fetchOfficialHolidaysWithSuccess:(void(^)(id responseObject))success
                                 failure:(void(^)(NSError *error))failure;

/// BMS 权限 SDK 初始化
/// - Parameter completion: 初始化回调
- (void)initSDKCompletion:(BMSInitCompletion)completion;

/// 触发隐私弹窗，回调用户是否同意
- (void)showPrivacyPopupWithCompletion:(void (^)(BOOL agreed))completion;

/// 判断是否需要弹出实名（基于后端或缓存逻辑）
- (BOOL)shouldShowRealname;

/// 主动触发实名弹窗
- (void)showRealnamePopupWithCompletion:(void (^)(BOOL success))completion;

/// 获取 BMS UUID
- (NSString *)BMSUUID;

/// 打开服务条款（默认实现，按需要替换 URL）
- (void)openTerms;

/// 打开隐私协议（默认实现，按需要替换 URL）
- (void)openPrivacy;

/// 单次震动，默认样式（短促）
- (void)vibrateOnce;

/// 自定义震动（使用 CoreHaptics 模拟间隔+时长震动）
- (void)vibrateWithPattern:(NSArray<NSNumber *> *)pattern
                    repeat:(NSInteger)repeat;

/// 取消震动（如果可取消）
- (void)vibrateCancel;

@end

NS_ASSUME_NONNULL_END
